package com.success.service.impl;

import com.success.dao.UserDAO;
import com.success.entity.User;
import com.success.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * Created by IntelliJ IDEA.
 *
 * @author MagicMushroom
 * @date 2021/6/26
 */
@Service
public class UserServiceImpl implements UserService {
    @Resource
    private UserDAO userDAO;


    @Override
    @Transactional(propagation = Propagation.SUPPORTS,readOnly = true)
    public User login(User user) {
        return userDAO.selectOneByUsernameAndPassword(user);
    }
}
